Complete logging migration from static Log.* to ILogger<T> dependency injection#177
Draft
Complete logging migration from static Log.* to ILogger<T> dependency injection#177
Conversation
Copilot
AI
changed the title
[WIP] Migrate Log.Debug() calls to ILogger pattern
Logging Migration Status Verification: Ticket #2 (Bulk Migration) Not Implemented
Feb 6, 2026
Contributor
|
@copilot Take a look at the start on the changes and finish the refactoring.. |
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Added using Microsoft.Extensions.Logging - Added ILogger<AnimationPlayer> field - Initialized logger using LoggingConfiguration.CreateLogger<AnimationPlayer>() - Converted 107 Log method calls: * 100 Log.Verbose → _logger.LogTrace * 7 Log.Exception → _logger.LogError * 5 Log.Audit left unchanged (not part of logging migration) Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Added using Microsoft.Extensions.Logging - Added static ILogger<AgentManager> field - Added SetLogger method for initialization - Converted 79 Log calls: - 51 Log.Debug → _logger?.LogDebug - 22 Log.Verbose → _logger?.LogTrace - 5 Log.Exception → _logger?.LogError - 1 Log.Warn → _logger?.LogWarning Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Changed empty string LogTrace calls to use method names - Makes logs more informative and useful for debugging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Replaced all Log.Debug() calls with _logger?.LogDebug() - Replaced all Log.Error() calls with _logger?.LogError() - Replaced all Log.Warn() calls with _logger?.LogWarning() - Replaced all Log.Exception() calls with _logger?.LogError(ex, ...) - Replaced all Log.Verbose() calls with _logger?.LogTrace() - Replaced all Log.IsNull() calls with _logger?.LogDebug() with null check logic - Logger field and constructor injection were already in place - Converted 68 logging calls total Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
…nager and UserManager Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Common.cs: Convert Log.Debug to structured logging with ILogger - DialogUtils.cs: Convert Log.Exception to LogError with exception - LaunchAppUserControl.cs: Convert Log.Info to LogInformation with structured logging - AutoCalibrateForm.cs: Convert 2 Log.Debug calls to LogDebug - Interpret.cs: Convert Log.Debug and Log.Exception to structured logging - PreferredPanelConfig.cs: Convert Log.Debug and Log.Exception to structured logging All conversions follow the modern ILogger pattern using LoggingConfiguration.CreateLogger<T>() and structured logging with message templates. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Converted all Log.* calls to modern ILogger pattern in: - Files with 2 Log calls: Fonts.cs, PreferencesBase.cs, TextUtils.cs (already converted), WebSearch.cs - Files with 3 Log calls: FileWriter.cs, NamedPipeServerConvAssist.cs (already converted), Keyboard.cs, ExtensionInvoker.cs, Parser.cs, ColorScheme.cs Used structured logging with parameterized messages for better performance and searchability. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Converted 3 Log calls in FileUtils.cs - Converted 3 Log calls in TimerQueue.cs - Converted 4 Log calls in Actuators.cs - Converted 4 Log calls in WinsockServerActuatorBase.cs - Converted 4 Log calls in AgentsCache.cs - Converted 4 Log calls in KeyLogTextControlAgent.cs - Converted 4 Log calls in Animation.cs - Converted 4 Log calls in OutlineWindow.cs - Converted 4 Log calls in SpellCheckers.cs - Converted 4 Log calls in UserControlBCISignalCheck.cs All conversions use structured logging with proper parameter substitution. Added ILogger fields and Microsoft.Extensions.Logging imports where needed. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- UserControlKeyboardCommon.cs: 4 Log calls converted - EnumWindows.cs: 4 Log calls converted (already had ILogger) - WidgetManager.cs: 4 Log calls converted (added static logger for static methods) - AlphabetScannerCommon.cs: 4 Log calls converted (already had ILogger) - DataParser.cs: 5 Log calls converted (added static logger) - gTecDeviceTester.cs: 5 Log calls converted (already had ILogger) - Abbreviations.cs: 5 Log calls converted (already had ILogger) - KeyboardActuator.cs: 5 Log calls converted (added static logger) - AnimationManager.cs: 5 Log calls converted (added static logger) - WindowHighlight.cs: 5 Log calls converted (added static logger) All conversions use structured logging with proper parameters. Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Converted all Log.Debug() to _logger.LogDebug() - Converted all Log.Error() to _logger.LogError() - Converted all Log.Exception(ex) to _logger.LogError(ex, ex.Message) - Converted Log.Verbose() to _logger.LogTrace() - Applied structured logging with named parameters - Converted string concatenation to template-based logging Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
- Fixed typo: AutoCOmpleteCaretPos → AutoCompleteCaretPos - Enhanced LogTrace message to include punctuation parameter Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
…ging - Initialize ILogger<OpenBCIDeviceTester> in constructor - Convert all 28 Log.Debug/Error/Exception calls to structured logging - Apply structured logging with message templates and parameters - Improve log message clarity and consistency Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Co-authored-by: michaelbeale-IL <63321611+michaelbeale-IL@users.noreply.github.com>
Copilot
AI
changed the title
Logging Migration Status Verification: Ticket #2 (Bulk Migration) Not Implemented
Complete logging migration from static Log.* to ILogger<T> dependency injection
Feb 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Completes the logging refactoring started in #178. Migrates all remaining production code from static
Log.Debug/Error/Info/Exceptioncalls to Microsoft.Extensions.LoggingILogger<T>pattern with structured logging.Scope
Changes
Pattern Applied
Conversion Mapping
Log.Debug(msg)→_logger.LogDebug(msg)Log.Error(msg)→_logger.LogError(msg)Log.Info(msg)→_logger.LogInformation(msg)Log.Exception(ex)→_logger.LogError(ex, ex.Message)Log.Verbose(msg)→_logger.LogTrace(msg)Structured Logging
String concatenation replaced with template parameters throughout:
"Value: " + count→"Value: {Count}", countMajor Files Converted
TextController.cs(34 calls)CameraActuator.cs(29 calls)PanelAnimationManager.cs(28 calls)OpenBCIDeviceTester.cs(28 calls)DecisionMaker.cs(26 calls)UserControlAnimationManager.cs(26 calls)Verification
Original prompt
This section details on the original issue you should resolve
<issue_title>[2] AI-Assisted Log.Debug() to ILogger Migration</issue_title>
<issue_description>Estimate: 2 days
Sprint: Week 1
Assignee: [Developer]
Description
Use AI to find and replace all
Log.Debug()calls with modernILogger<T>pattern across the entire codebase. This is the bulk conversion work.Context
AI Prompt
Manual Tasks
Acceptance Criteria
Log.Debug()calls replaced with_logger.LogDebug()Log.Error()calls replaced with_logger.LogError()ILogger<T>injectedLog.Debug(in codebase (verified by search)Example Conversion
Validation Script
Dependencies
Notes
Log.csfile temporarily for reference[Obsolete]attribute initially🎫 Ticket #3: Update Application Entry Points with Logging DI
Labels:
phase-1-foundation,logging,P1-High,setupEstimate: 1 day
Assignee: [Developer]
Sprint: Week 1
Description
Update all application entry points (Program.cs, WinForms startup) to configure dependency injection and logging services. This makes ILogger available throughout the application.
Context
Tasks
ServiceConfiguration.cshelper class💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.